﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="List.ascx.vb" Inherits="Control_Store_List" %>

	<script type='text/javascript'>

	    $(function () {

	        $(".TextBox:first").focus();
	    });
	    function CheckAll() {
	        if ($("#<%= grdShow.ClientID %> tr th span").find("input[type=checkbox]").attr("checked") == true) {
	            if ($("#<%= grdShow.ClientID %> tr td").find("input[type=checkbox]").attr('disabled') != true) {

	                $("#<%= grdShow.ClientID %> tr td").find("input[type=checkbox]").attr('checked', true);
	            }
	        } else {

	            $("#<%= grdShow.ClientID %> tr td").find("input[type=checkbox]").attr('checked', false);
	        }
	    }
	    function confirmMultiDelete(strID) {
	        var grdShow = document.getElementById("<%=grdShow.ClientID %>");
	        var count = 0;
	        for (i = 1; i < grdShow.children.item(0).children.length; i++) {
	            if (grdShow.children.item(0).children.item(i).children.item(0).children.item(0).checked) {
	                count += 1;
	            }
	        }
	        if (count > 0) {
	            return ComfirmDialog('<%=drpMessage.Items(1).Text%>', 0, strID, 0, 0);
	        } else {
	            Alertbox('<%=drpMessage.Items(2).Text%>');
	            return false;
	        }
	    }
	    function ComfirmDialog(strText, value, ObjectIdClick, ID, Type) {
	        if (value == 0) {
	            Confirmbox(strText, value, ObjectIdClick, ID, Type);
	            return false;
	        } else {
	            if (Type == 1) {
	                document.getElementById('<%=hidID.ClientID %>').value = ID;
	                eval($("#" + ObjectIdClick + "").attr("href"));
	            }
	            else {

	                $("#" + ObjectIdClick + "").click();
	            }
	        }
	    }
	</script>
	<asp:UpdatePanel ID="uplStore" runat="server">
	<ContentTemplate>
	<div class="BoxField" ></div>
	<div class="HeadTitle"><h3>QUẢN LÝ SALON</h3></div><div class="SubjectTitle" >Lọc theo tiêu đề:<asp:TextBox ID="txtTitleFilter" runat="server" CssClass='TextBox'></asp:TextBox><asp:Button ID="btnFilter" runat="server" Text='Lọc' CssClass='btn' /></div>
	<div>
        <asp:GridView ID="grdShow" runat="server" AutoGenerateColumns="False" 
            BorderWidth="1px" CssClass="GridBorder" EmptyDataText="{Không có dữ liệu}" 
            Width="100%">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox ID="CheckAll" runat="server" onclick="CheckAll();" Width="30px" />
                    </HeaderTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <asp:CheckBox ID="chkItem" runat="server" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="5%" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:HyperLink ID="hplEdit" runat="server" Text="Sửa"></asp:HyperLink>
                        &nbsp;|&nbsp;
                        <asp:LinkButton ID="lnkbtnDelete" runat="server" CausesValidation="False" 
                            OnClick="lnkbtnDelete_Click" Text="Xóa"></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle CssClass="GridTextLink" HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="No">
                    <ItemTemplate>
                        <asp:Label ID="lblSTT" runat="server" Text=""></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left" Width="5%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tiêu đề">
                    <ItemTemplate>
                        <asp:HyperLink ID="hplTitle" runat="server"></asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle CssClass="text_list_links" HorizontalAlign="Left" Width="20%" />
                </asp:TemplateField>
                      <%--                <asp:BoundField DataField="ContactUs" HeaderText="Liên hệ">
                <ItemStyle Width="10%" />
                </asp:BoundField>--%>
                <asp:BoundField DataField="UserName" HeaderText="Người dùng">
                <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="Viewed" HeaderText="Lượt xem">
                <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="TotalVote" HeaderText="Lượt Vote">
                <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="StatusName" HeaderText="Trạng thái">
                <ItemStyle Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="PublishedDate" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày xuất bản">
                <ItemStyle Width="10%" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle CssClass="GridHeader" Height="26px" HorizontalAlign="Left" />
            <RowStyle CssClass="GridRow" Height="23px" />
            <AlternatingRowStyle CssClass="GridAlterRow" />
            <PagerStyle CssClass="GridPaged" Height="23px" HorizontalAlign="Right" />
            <PagerSettings Mode="Numeric" PageButtonCount="2" />
            <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
        </asp:GridView>
  
        <asp:Button ID="btnDelete" CssClass="btn" runat="server" Text="Xóa" /> <asp:Label ID="lblPage_Size" runat="server" Text="Số bản ghi trên trang:" ></asp:Label>		 <asp:DropDownList ID="drpPage_Size" runat="server" AutoPostBack="True" Width="70px" CssClass="input_form">
		 <asp:ListItem Text="10" Value="10"></asp:ListItem>
		 <asp:ListItem Text="20" Value="20"></asp:ListItem>
		 <asp:ListItem Text="50" Value="50"></asp:ListItem>
		 <asp:ListItem Text="100" Value="100"></asp:ListItem>
		 </asp:DropDownList>
		  <asp:Label ID="lblTotal" runat="server"></asp:Label></div>
	<div style="width: 100%">
		 <!--phan trang-->
		 <div id="results_resultsNavigationDiv" class="paginationEMP">
		 <ul>
		     <asp:LinkButton ID="lnkFirst" runat="server"></asp:LinkButton>
		     <asp:Repeater ID="rptPage" runat="server">
		         <ItemTemplate>
		              <asp:LinkButton ID="lnkTitle" CssClass="page_num" runat="server" OnClick="lnkTitle_Click"></asp:LinkButton>
		         </ItemTemplate>
		    </asp:Repeater>
		    <asp:LinkButton ID="lnkLast" runat="server"></asp:LinkButton>
		   </ul>
		  </div>
		  <asp:HiddenField ID="hidCount" Value="0" runat="server" />
		 <asp:HiddenField ID="hidIndex_page" Value="0" runat="server" />
		 <asp:HiddenField ID="hidCur_Page" Value="1" runat="server" />
		  </div>
	<div style='display: none'>
	<asp:DropDownList ID="drpMessage" runat="server" >
		  <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản ghi này không?' Value='0'></asp:ListItem>
		   <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản đã chọn?' Value='1'></asp:ListItem>
	 <asp:ListItem Text='Bạn phải chọn ít nhất một bản ghi.' Value='2'></asp:ListItem>
	</asp:DropDownList>
	 <asp:HiddenField ID="hidID" Value="0" runat="server" />
	</div>
	</ContentTemplate>
	</asp:UpdatePanel>

